package com.hsc.yalebao.tools;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import com.hsc.yalebao.weight.LogUtils;
import java.text.SimpleDateFormat;
import java.util.Date;

public class SMSBroadcastReceiver extends BroadcastReceiver
{
  public static final String SMS_RECEIVED_ACTION = "android.provider.Telephony.SMS_RECEIVED";
  private static MessageListener mMessageListener;

  public void onReceive(Context paramContext, Intent paramIntent)
  {
    Object[] arrayOfObject;
    int i;
    if (paramIntent.getAction().equals("android.provider.Telephony.SMS_RECEIVED"))
    {
      arrayOfObject = (Object[])paramIntent.getExtras().get("pdus");
      i = arrayOfObject.length;
    }
    for (int j = 0; ; j++)
    {
      if (j >= i)
        return;
      SmsMessage localSmsMessage = SmsMessage.createFromPdu((byte[])arrayOfObject[j]);
      String str1 = localSmsMessage.getDisplayOriginatingAddress();
      String str2 = localSmsMessage.getDisplayMessageBody();
      Date localDate = new Date(localSmsMessage.getTimestampMillis());
      new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(localDate);
      LogUtils.d("发送者：", str1);
      if ("106575632853135671".equals(str1))
      {
        LogUtils.d("短信内容：", str2);
        if ((str2 != null) && (!"".equals(str2)))
        {
          String str3 = str2.substring(10, 16);
          LogUtils.d("截取后的短信内容：", str3);
          mMessageListener.onReceived(str3);
        }
      }
    }
  }

  public void setOnReceivedMessageListener(MessageListener paramMessageListener)
  {
    mMessageListener = paramMessageListener;
  }

  public static abstract interface MessageListener
  {
    public abstract void onReceived(String paramString);
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tools.SMSBroadcastReceiver
 * JD-Core Version:    0.6.2
 */